package dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import javax.swing.JOptionPane;



public class AccessDatabase  implements IDatabase{
	
	
	
	@Override
	public Connection conectar(){
		

        try{
            
            String url = "jdbc:mysql://localhost/extremeexplorationbd";
            String usuario = "root";
            String senha = "abcd1234";
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            return DriverManager.getConnection(url,usuario,senha);
            }
        catch ( ClassNotFoundException | SQLException e){
			 JOptionPane.showMessageDialog(null,"Connection not established: "+e.getMessage(),"Mensagem do Programa",
			 JOptionPane.ERROR_MESSAGE);
			 System.exit(0);

		}
		return null;
    }

	}
	


